//////   WordCount.java   //////

public class WordCount {
	static  Cirbuf buf;
	public static void main(String args[]) {
		buf = new Cirbuf();
		Producer pd = new Producer(buf);
		Consumer cs = new Consumer(buf);
		pd.start(); // producer thread now running
		cs.start(); // consumer thread now running
		try {
			pd.join();
			cs.join();
		} catch (InterruptedException e) {
		}
		System.out.println("total " + cs.count() + " words");
	}
}
